<!DOCTYPE html>
<html lang="cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>陆梓峰 24510206097</p>
</body>

</html>
<script>
    // 需求： 用户输入天数，可以自动转换为周加天 例如输入9就返回一周两天
    let week = +prompt("请输入天数：");

    function getWeek(w) {
        w = parseInt(w / 7);
        d = parseInt(w % 7);
        w = w < 7 ? ('0' + w) : w;
        d = d < 7 ? ('0' + d) : d;
        return (w + "周" + d + "天");
    }
    let nowWeek = getWeek(week);
    document.write(nowWeek);


    // 需求： return返回多个值。例如一个函数有四个参数a,b,c,d，需要返回a+b和c*d的结果
    let a = +prompt("请输入第一个数：");
    let b = +prompt("请输入第二个数：");
    let c = +prompt("请输入第三个数：");
    let d1 = +prompt("请输入第四个数：");

    function getArr(a, b, c, d1) {
        let sum = a + b
        let sum1 = c * d1
        return [sum, sum1];
    }
    let [sum, sum1] = getArr(a, b, c, d1);
    document.write(sum);
    document.write(sum1);
</script>